package com.smarthospital.dao.daoService;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.smarthospital.dao.mapper.HospitalDao;
import com.smarthospital.entity.pojo.Hospital;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class HospitalDaoService{

    @Resource
    private HospitalDao hospitalDao;

    public int insert(Hospital pojo){
        return hospitalDao.insert(pojo);
    }

    public int insertSelective(Hospital pojo){
        return hospitalDao.insertSelective(pojo);
    }

    public int insertList(List<Hospital> pojos){
        return hospitalDao.insertList(pojos);
    }

    public int update(Hospital pojo){
        return hospitalDao.update(pojo);
    }

    public PageInfo<Hospital> querHospitals(Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum,pageSize);
        List<Hospital> list = hospitalDao.querHospitals();
        return PageInfo.of(list);
    }
}
